package com.zzh.lib.core.model;

import android.os.Parcel;

/**
 * Created by ZZH on 2023/2/1.
 *
 * @date: 2023/2/1 22:04
 * @email: zzh_hz@126.com
 * @author: zzh
 * @description: com.zzh.lib.core.model
 */
public class HAudioFileModel extends HFileModel {
    private long duration;
    private String displayName;
    private String album;
    private String albumArtist;
    private String albumId;
    private String author;
    private String artist;
    private String artistId;
    private String artistKey;
    private String albumKey;
    private boolean isFavorite;

    public String getArtistId() {
        return artistId == null ? "" : artistId;
    }

    public HAudioFileModel setArtistId(String artistId) {
        this.artistId = artistId;
        return this;
    }

    public String getArtistKey() {
        return artistKey == null ? "" : artistKey;
    }

    public HAudioFileModel setArtistKey(String artistKey) {
        this.artistKey = artistKey;
        return this;
    }

    public String getAlbumKey() {
        return albumKey == null ? "" : albumKey;
    }

    public HAudioFileModel setAlbumKey(String albumKey) {
        this.albumKey = albumKey;
        return this;
    }

    public String getArtist() {
        return artist == null ? "" : artist;
    }

    public HAudioFileModel setArtist(String artist) {
        this.artist = artist;
        return this;
    }

    public String getDisplayName() {
        return displayName == null ? "" : displayName;
    }

    public HAudioFileModel setDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    public String getAlbum() {
        return album == null ? "" : album;
    }

    public HAudioFileModel setAlbum(String album) {
        this.album = album;
        return this;
    }

    public String getAlbumArtist() {
        return albumArtist == null ? "" : albumArtist;
    }

    public HAudioFileModel setAlbumArtist(String albumArtist) {
        this.albumArtist = albumArtist;
        return this;
    }

    public String getAlbumId() {
        return albumId == null ? "" : albumId;
    }

    public HAudioFileModel setAlbumId(String albumId) {
        this.albumId = albumId;
        return this;
    }

    public String getAuthor() {
        return author == null ? "" : author;
    }

    public HAudioFileModel setAuthor(String author) {
        this.author = author;
        return this;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }


    public HAudioFileModel() {
    }

    @Override
    public String toString() {
        return "HAudioFileModel{" +
                "duration=" + duration +
                ", displayName='" + displayName + '\'' +
                ", album='" + album + '\'' +
                ", albumArtist='" + albumArtist + '\'' +
                ", albumId='" + albumId + '\'' +
                ", author='" + author + '\'' +
                ", artist='" + artist + '\'' +
                ", artistId='" + artistId + '\'' +
                ", artistKey='" + artistKey + '\'' +
                ", albumKey='" + albumKey + '\'' +
                "} " + super.toString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeLong(this.duration);
        dest.writeString(this.displayName);
        dest.writeString(this.album);
        dest.writeString(this.albumArtist);
        dest.writeString(this.albumId);
        dest.writeString(this.author);
        dest.writeString(this.artist);
        dest.writeString(this.artistId);
        dest.writeString(this.artistKey);
        dest.writeString(this.albumKey);
    }

    public void readFromParcel(Parcel source) {
        super.readFromParcel(source);
        this.duration = source.readLong();
        this.displayName = source.readString();
        this.album = source.readString();
        this.albumArtist = source.readString();
        this.albumId = source.readString();
        this.author = source.readString();
        this.artist = source.readString();
        this.artistId = source.readString();
        this.artistKey = source.readString();
        this.albumKey = source.readString();
    }

    protected HAudioFileModel(Parcel in) {
        super(in);
        this.duration = in.readLong();
        this.displayName = in.readString();
        this.album = in.readString();
        this.albumArtist = in.readString();
        this.albumId = in.readString();
        this.author = in.readString();
        this.artist = in.readString();
        this.artistId = in.readString();
        this.artistKey = in.readString();
        this.albumKey = in.readString();
    }

    public static final Creator<HAudioFileModel> CREATOR = new Creator<HAudioFileModel>() {
        @Override
        public HAudioFileModel createFromParcel(Parcel source) {
            return new HAudioFileModel(source);
        }

        @Override
        public HAudioFileModel[] newArray(int size) {
            return new HAudioFileModel[size];
        }
    };
}
